﻿@using SCMS.Resource
@{
    ViewBag.Title = Resources.Global_String_RequestForAdvance + " - " + Resources.Global_String_SupplyChainManagementSystem;
    Layout = "~/Views/Shared/_GeneralLayout.cshtml";
}

<div id="rfaMain" class="contentMain">
<div class="contentHeader">
    <div class="headerText">
        <h3 class="title-left">
            @Resources.Global_String_RequestForAdvance</h3>
    </div>
    <div style="font-size: 13px; text-align: left;">
        <table cellpadding="0" cellspacing="0">
            <tr>
                @if (UserContext.HasPermission(StandardPermissionProvider.RequestForAdvanceManage))
                {
                    <td class="arrowLink">
                        @Ajax.ActionLink(Resources.Global_String_AddNew, "CreateRFA", new { id = "CreateRFA" }, new AjaxOptions
                        {
                            UpdateTargetId = "R4ADiv",
                            LoadingElementId = "loading",
                            Url = Url.Action("CreateRFA"),
                            OnSuccess = "initDatePicker"
                        })
                    </td>
                }
                else
                { 
                    <td>&nbsp;</td>
                }
            </tr>
            <tr>
                <td class="arrowLink">
                    @Ajax.ActionLink(Resources.Request4Advance_Index_ViewRequestsForAdvance, "Index", new { id = "ViewR4A" }, new AjaxOptions
                    {
                        UpdateTargetId = "R4ADiv",
                        LoadingElementId = "loading",
                        Url = Url.Action("ViewR4A"),
                        OnSuccess = "if (document.getElementById('table') != null) {initSorter(); sorter.size(50);}"
                    })
                </td>
            </tr>
        </table>
    </div>
</div>
<br />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
        <td width="50%" align="center">
            <div id="popupDiv" class="popup" style="display: none;">
            </div>
        </td>
        <td width="50%">
        </td>
    </tr>
</table>
<div id="loading" style="display: none; color: Blue; font-weight: bold;">
    <img src="../../Content/images/loading_indicator.gif" alt="@Resources.Global_String_Processing" />
</div>
<div id="R4ADiv">
    <!-- Content goes here-->
    @Html.Action("ViewR4A")
</div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        if (document.getElementById('table') != null) {
            initSorter();
            sorter.size(50);
        }
    });
</script>